<?php

class serviceFactory {
    private static $instance = null;
    private static $serviceSet = array();

    public static function getInstance () {
        if (!self::$instance) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    public function getCategorysService () {
        if (!isset(self::$serviceSet['CategorysService'])) {
            require_once 'modules/service/Impl/categorysService.php';
            self::$serviceSet['CategorysService'] = new CategorysService();
        }
        return self::$serviceSet['CategorysService'];
    }

    public function getLinksService () {
        if (!isset(self::$serviceSet['LinksService'])) {
            require_once 'modules/service/Impl/linksService.php';
            self::$serviceSet['LinksService'] = new LinksService();
        }
        return self::$serviceSet['LinksService'];
    }
}
